import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import setting from './setting'
import { Button, Avatar, Modal, Icon, Drawer, FormModel, Input, Select, Card, Tabs, message } from 'ant-design-vue';
import "@/style/index.less"

Vue.use(Button).use(Avatar).use(Modal).use(Icon).use(Drawer).use(FormModel).use(Input).use(Select).use(Card).use(Tabs).use(message)
const remote = require('electron').remote
const { session, app } = require('electron').remote
const fs = require('fs')

Vue.prototype.getSteamRegedit('HKCU/SOFTWARE/Valve/Steam', (res) => {//获取注册项下的Steam路径
  if (res.values.SteamExe.value) {
    if (res.values.SteamExe.value) {
      Vue.prototype.url = res.values.SteamPath.value
      console.log( Vue.prototype.url,'-----');
    }
  }
})
Vue.prototype.readFile((data) => {//获取config
  if (!data.libraryfolders) {//如果libraryfolders不存在则去获取
    setting.getSteamUrl()
  }
})//查看是否有配置文件

Vue.prototype.fs = fs;
Vue.prototype.remote = remote;
Vue.prototype.app = app;
Vue.prototype.session = session;


Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
